<template>
  <div >
   <label v-for="(item,index) in arr" :key="index"  >
      <input type="checkbox" :value="item" v-model="arr1">{{item}}
   </label>
     <p>你选中的元素，累加的值和为：{{sum}}</p>
   </div>
</template>
 
<script>
export default {
 
  components: {},
  props: {},
  data() {
    return {
      arr:[9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
      arr1:[]
    };
  },
  computed: {
    sum(){
      return this.arr1.reduce((acc, item) => acc+ item,0)
    }
  },
  watch: {},
  created() {},
  methods: {}
};
</script>

<style scoped>
     
</style>